context('4:Toolbar', () => {
    context('0: Basic', () => {
        test('2: More Button Types', () => {
            let menu_item = '#w2ui-overlay-toolbar .w2ui-menu-item'
            bela
                .ready('/w2ui/demos/#/toolbar/2')
                .get('#toolbar .w2ui-tb-button')
                .should('have.length', 6)
                .begin('Regular Menu')
                    .get('#tb_toolbar_item_item1')
                    .click()
                    .wait('#w2ui-overlay-toolbar', 'to.appear')
                    .wait(20) // wait for popup to apper so user can see
                    .get(menu_item)
                    .should('have.length', 3)
                    .trigger('mousedown')
                    .wait(20) // wait for click to apper so user can see
                    .click()
                    .wait('#w2ui-overlay-toolbar', 'to.disappear')
                .end()
                .begin('Radio Menu')
                    .get('#tb_toolbar_item_item2')
                    .click()
                    .wait('#w2ui-overlay-toolbar', 'to.appear')
                    .wait(20) // wait for popup to apper so user can see
                    .get(menu_item)
                    .should('have.length', 3)
                    .trigger('mousedown')
                    .wait(20) // wait for click to apper so user can see
                    .get(menu_item +':nth-child(1) .w2ui-icon')
                    .should('have.class', 'w2ui-icon-check')
                    .get(menu_item +':nth-child(3) .w2ui-icon')
                    .should('not.have.class', 'w2ui-icon-check')
                    .get(menu_item)
                    .click()
                    .wait('#w2ui-overlay-toolbar', 'to.disappear')
                .end()
                .begin('Check Menu')
                    .get('#tb_toolbar_item_item3')
                    .click()
                    .wait('#w2ui-overlay-toolbar', 'to.appear')
                    .wait(20) // wait for popup to apper so user can see
                    .get(menu_item)
                    .should('have.length', 4)
                    .trigger('mousedown')
                    .wait(20) // wait for click to apper so user can see
                    .get(menu_item +':nth-child(1) .w2ui-icon')
                    .should('have.class', 'w2ui-icon-check')
                    .get(menu_item +':nth-child(3) .w2ui-icon')
                    .should('have.class', 'w2ui-icon-check')
                    .get(menu_item)
                    .click()
                    .wait('#w2ui-overlay-toolbar', 'to.disappear')
                .end()
                .begin('Check Menu')
                    .get('#tb_toolbar_item_item4')
                    .click()
                    .wait('#w2ui-overlay-toolbar', 'to.appear')
                    .wait(20) // wait for popup to apper so user can see
                    .get('#w2ui-overlay-toolbar')
                    .should('contain.text', 'You can put any HTML')
                .end()
                .begin('Other buttons')
                    .get('#tb_toolbar_item_item5')
                    .should('contain.text', 'CUSTOM')
                    .get('#toolbar .w2ui-tb-spacer')
                    .should('have.length', 1)
                .end()
        })
    })
})